/*Entry Cost Analysis
STATA 14
January 15, 2017
Replicates Figure2 - Non-Response*/

cd  "C:\Users\ejm5\Dropbox\Rents_Asunder\CountryofOrigin\20160315_InternationaOrganization\Replication"
use  oecd_7years_working.dta, clear
log using non_response.smcl, replace

generate non_response=100 if e6==.
replace non_response=0 if e6!=.
lab var non_response "Traditional"
generate non_response_uct=100 if c6==.b
replace non_response_uct=0 if c6<=4
lab var non_response_uct "List"

ttest non_response =non_response_uct
ciplot non_response non_response_uct, level(90)

#delimit;
ciplot non_response non_response_uct, mcolor(maroon) level(95) legend(rows(2) ring(0) position(11) size(small) label(2 Traditional Question) label(3 List Question))
ytitle("Share of Firms Not Responding (%)", size(medium) margin(medium)) title("All Respondents (2009 to 2016)", size(medium)) scheme(s1mono) xtitle("", margin(med))
note("") xtitle("Question Type", size(medium) margin(medium));
graph save nr_all.gph, replace;

/***********************************************/


keep if year==2010|year==2011;


generate survey_conducted=2009 if year==2010;
replace survey_conducted=2010 if year>2010;
lab var survey_conducted "Year Survey Conducted";

ttest non_response, by(survey_conducted);
ttest non_response_uct, by(survey_conducted);


#delimit;
ciplot non_response non_response_uct if oecd==1, mcolor(maroon) level(95) by(survey_conducted)  legend(rows(2) ring(0) position(11) size(small) label(2 Traditional Question) label(3 List Question))
ytitle("Share of Firms Not Responding (%)", size(medium) margin(medium)) title("OECD-ABC Signatory (2009 & 2010)", size(medium)) scheme(s1mono) xtitle(, margin(med))
legend(off) note("") xtitle(, size(medium) margin(medium));
graph save nr_oecd.gph, replace;


#delimit;
graph combine nr_all.gph nr_oecd.gph, ycommon cols(3) imargin(tiny) scheme(s1mono) note("Range Bars=95% Confidence Intervals");
graph save non_response.gph, replace;
graph export Figure2.pdf, as(pdf) replace;
log close;


